class ZCL_FORMTEMPLATE_SRV_01 definition
  public
  create public .

public section.

  interfaces IF_HTTP_SERVICE_EXTENSION .
protected section.
private section.
ENDCLASS.



CLASS ZCL_FORMTEMPLATE_SRV_01 IMPLEMENTATION.


  method IF_HTTP_SERVICE_EXTENSION~HANDLE_REQUEST.
    DATA: lt_table TYPE TABLE OF zformtemplate_01,
          ls_table LIKE LINE OF lt_table.

    CASE request->get_method( ).

      WHEN CONV string( if_web_http_client=>post ).

        DATA(lv_text) = request->get_text( ).

        ls_table-formid = 'ZDEMOTEST'.
        " ls_table-formid = 'ZDEMOTEST001'.
        ls_table-form_binary = cl_abap_conv_codepage=>create_out( )->convert( lv_text ).
        MODIFY zformtemplate_01 FROM @ls_table.
        response->set_text( 'upload success!').
  ENDCASE.
  endmethod.
ENDCLASS.
